package com.zwps.common.tool;

public class ClassTool {

    /**
     * 
     * @Title: isWrapperArray
     * @Description: Byte[] | Character[] | Short[] | Integer[] | Float[] | Long[] |
     *               Double[]
     * @param type
     * @return boolean
     * @throws
     */
    public static boolean isWrapperArray(Class<?> type) {
        return type.isArray() && isWrapper(type.getComponentType());
    }

    public static boolean isWrapper(Class<?> type) {
        return type == Byte.class || type == Character.class || type == Short.class || type == Integer.class
                || type == Float.class || type == Long.class || type == Double.class;
    }

    /**
     * 
     * @Title: isPrimitiveArray
     * @Description: byte[] | char[] | short[] | int[] | float[] | long[] | double[]
     * @param type
     * @return boolean
     * @throws
     */
    public static boolean isPrimitiveArray(Class<?> type) {
        return type.isArray() && type.getComponentType().isPrimitive();
    }
}
